<?php
/**
 * Author：小鱼
 * QQ:34734852
 * Wechat:34734852
 */
namespace Home\Controller;
use Think\Controller;

class NewsController extends ActionController {
    public function  Index(){
        $this->fenye('news',array('n_type'=>1),'n_date desc','news','page','10');
        $this->display();
    }
    public function view(){    
        $id = I('get.newsid','','strip_tags');
        if(!empty($id)){
            $shuju = $this->one_data('news',array('n_id'=>$id));
            if($shuju == NULL){
                $this->error('非法操作！',U('News/index'),3);
            }else{
                $this->assign('content',$shuju);
                $this->display();
            }
        }else{
            $this->error('非法操作！',U('News/index'),3);
        }
        
    }
}
